<%@ page language="java" import="Clases.*,BasedeDatos.*,java.sql.*,Operaciones.*,java.util.*;" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sistema de notificacion de errores Comunidad Aura</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.style1 {
	text-align: center;
}
.style2 {
	background-image: url('images/news_bg_rpt.jpg');
	text-align: center;
	width: 680px;
	background-color: #353434;
	color: #C7D0D5;
	font-size: 13px;
}
.auto-style1 {
	font-size: medium;
	color: #FFFFFF;
}
</style>
</head>
<body>
<center>
<div id="wrapper">
    <div id="header"></div>


    <div class="black">
	<div id="nav">
	<ul>
	<li><a href="index.html" >Entrada</a></li>
	<li><a href="FrontController?res=entrada.jsp">Informe</a></li>
	<li><a href="FrontController?res=mipanel.jsp"> Panel de panel de control</a></li>
	<li><a class="current" > Seleccion de informe</a></li>
	</ul>
	</div>
	</div>
    <div id="content">


    <div class="newstitle"><p class="margin" align="center" style="text-align: left"></p></div>
    <div class="newscontent">
    <% 	
    		Control c = new Control();
    		usuarioJDBC jdbcu = new usuarioJDBC();
    		Usuario u;
    		u = jdbcu.selectUsuario((String)session.getAttribute("session.user"));
    		int guid = u.getGuid();
			OperacionesBD op = new OperacionesBD();
			ArrayList<Mision> l = op.selectReporteMision(guid);
			
    %>
    
		<table style="width: 100%">
		<tr>
				<td class="style1" style="width: 323px">
				<p class="auto-style1">Nombre Usuario</p>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Identificador Mision Ali</p>
				</td>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Identificador Mision Horda</p>
				</td>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Identificador Ambas</p>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Reparar</p>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Eliminar informe</p>
				</td>
				</td>
				<td class="style1" style="width: 331px">
				<p class="auto-style1">Notificar boqueo</p>
				</td>
		</tr>
		<% 
		
		if(l.size()!= 0){
			Iterator it = l.iterator();
			while(it.hasNext()){
			Mision mision = (Mision)it.next();
			int entryA = mision.getEntryA();
			int entryH = mision.getEntryH();
			int ambas = mision.getAmbas();
			Usuario u2 = new Usuario();
			u2 = op.selectUsuarioGuidMISION(entryA,entryH,ambas);
			String user = u2.getNUser();
			int guid2 = u2.getGuid();

		%>
		
			<tr>
				<td style="width: 323px" class="style1"> <%=user%> </td>
				<td class="style1"> <%=mision.getEntryA()%> </td>
				<td class="style1"> <%=mision.getEntryH()%> </td>
				<td class="style1"> <%=mision.getAmbas()%> </td>
				<td class="style1"><a href="FrontController?res=repararmision.jsp?entryA=<%=entryA%>&entryH=<%=entryH%>&ambas=<%=ambas%>">
				<img src='images/reparar.png'></img></a> </td>
				<td class="style1">
				<a href="FrontController?res=eliminarmision.jsp?entryA=<%=entryA%>&entryH=<%=entryH%>&ambas=<%=ambas%>">
				<img src='images/eliminar.png'></img></a> </td>
				<td class="style1">
				<a href="FrontController?res=parabanear.jsp?guid=<%=guid2%>">
				<img src='images/ban.png'></img></a> </td>
			</tr>
			
		
					<%
					
				}
			}
			else{%>
			<tr>
				<td class="style1" colspan="7"> 
				<p class="auto-style1">NO HAY INFORMES DE ESTE TIPO.</p>
				</td>
			</tr>
			
		<%
			}
		
		%>		
		</table>
		
		<form action ="FrontController?res=mipanel.jsp" method="post">
				  <div class="style1">
				  <input name="guardar0" style="width: 137px; height: 42px" type="submit" value="Volver" /></strong></td>
				  </div>
				  </form> 

		
	</div>
<div id="newsfooter"></div>
<div id="footer" style="width: 683px">Comunidad WOW AURA</div>
</center>
</body>
</html>